<?php
use think\facade\Route;

Route::group('sunAdmin',function(){
    //管理员账户管理
    Route::group('account',function(){
        Route::post('login','AccountController/login');
        Route::get('tokenAuth','AccountController/tokenAuth');
        Route::get('loginOut','AccountController/loginOut');
        Route::get('accountOffLine/:accountId','AccountController/accountOffLine');
		//管理员角色组
		Route::get('getGroupList','AccountController/getGroupList');
		Route::post('editAccountGroup','AccountController/editAccountGroup');
		Route::get('deleteAccountGroup/:groupId','AccountController/deleteAccountGroup');
    	//管理员列表
		Route::get('getAccountList','AccountController/getAccountList');
		Route::post('editAccount','AccountController/editAccount');
		Route::get('delAccount/:accountId','AccountController/delAccount');
	});
    //ws
    Route::group('ws',function(){
        Route::get('sunAdmin','WsController/sunAdmin');
    });

    //菜单
    Route::group('menus',function(){
        Route::get('getAllMenus','MenusController/getAllMenus');
        Route::post('edit','MenusController/edit');
        Route::get('deleteMenus/:menusId','MenusController/deleteMenus');
    });

    //数据字典
    Route::group('dataDictionary',function(){
        Route::get('getCateTreeList','DataDictionaryController/getCateTreeList');
        Route::get('getCateInnerDataList/:cateId','DataDictionaryController/getCateInnerDataList');
        Route::post('edit','DataDictionaryController/edit');
        Route::get('delete/:id','DataDictionaryController/delete');
    });
	//附件
	Route::group('attachment',function(){
		Route::post('upload','AttachmentController/upload');
		Route::post('delete','AttachmentController/delete');
		Route::post('getList','AttachmentController/getList');
		Route::get('getUploadConfig','AttachmentController/getUploadConfig');
        //文件系统配置
        Route::get('getFilesystemConfigs','AttachmentController/getFilesystemConfigs');
        Route::post('updateFilesystemConfig','AttachmentController/updateFilesystemConfig');
	});
    //系统信息
    Route::group('systemInfo',function(){
        Route::get('metrics','SystemInfoController/getSystemMetrics');
    });
    //定时任务
    Route::group('timerTask',function(){
        Route::post('getTaskList','TimerTaskController/getTaskList');
        Route::post('save','TimerTaskController/save');
        Route::post('getTaskLogs','TimerTaskController/getTaskLogs');
        Route::post('manualExecute','TimerTaskController/manualExecute');
    });
})->namespace('SunAdmin\Controller')->middleware(\SunAdmin\Middleware\Auth::class); 